<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort() +request.getContextPath()+"/";
%>
<!DOCTYPE html>
<html>
<head>
	<base href="<%=basePath %>">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>所有队伍信息</title>
    <link rel="icon" href="https://i.loli.net/2020/03/14/mifePoZ49v8s1pr.jpg" type="icno/x-icno">
    <!-- 引入bootstrap分页 -->
    <link rel="stylesheet" href="<%=basePath%>/static/js/bootstrap/bootstrap.css" />
    <script src="<%=basePath%>/static/js/bootstrap/jquery.min.js"></script>
    <script src="<%=basePath%>/static/js/bootstrap/bootstrap.min.js"></script>
    <script src="<%=basePath%>/static/js/bootstrap/bootstrap-paginator.js"></script>
    <script>
        $(function() {
            $('#pagination').bootstrapPaginator({
                bootstrapMajorVersion: 3,
                currentPage: ${requestScope.pageInfo.pageNum },
                totalPages: ${requestScope.pageInfo.pages },
                pageUrl: function(type, page, current) {
                    return 'front/getAllPlayers.do?pageNum=' + page;
                },
                itemTexts: function(type, page, current) {
                    switch(type) {
                        case "first":
                            return "首页";
                        case "prev":
                            return "上一页";
                        case "next":
                            return "下一页";
                        case "last":
                            return "末页";
                        case "page":
                            return page;
                    }
                }
            });
        });
    </script>
</head>
<body>
<center>
    <table width="800px" border="1px" cellspacing="0px" cellpadding="5px">
        <thead>
        <tr>
            <td>队名</td>
            <td>队员1</td>
            <td>队员1_班级</td>
            <td>队员2</td>
            <td>队员2_班级</td>
            <td>队员3</td>
            <td>队员3_班级</td>
            <td>队长电话</td>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${pageInfo.list}" var="temp">
            <tr>
                <td>${temp.teamName}</td>
                <td>${temp.competitorName_1}</td>
                <td>${temp.class_1}</td>
                <td>${temp.competitorName_2}</td>
                <td>${temp.class_2}</td>
                <td>${temp.competitorName_3}</td>
                <td>${temp.class_3}</td>
                <td>${temp.captain_phone}</td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <!-- 把分页搞出来 -->
    <ul id="pagination"></ul>
</center>
</body>
</html>
